let router = new require('koa-router')()

router.all('/getBrandList', function (ctx) {
  ctx.body = {
    success: true,
    list: [
      {
        id: 1,
        name: '涨8-PC',
        domainName: "http://www.zhang8.com.cn"
      },
      {
        id: 2,
        name: '涨8-H5',
        domainName: "http://m.zhang8.com.cn"
      }, 
      {
        id: 3,
        name: '财云-PC',
        domainName: "http://www.18cloud.com"
      },
      {
        id: 4,
        name: '财云-H5',
        domainName: "http://m.18cloud.com"
      }
    ]
  }
})

router.all('/getAllTempLateByBrandId/:brandId', ctx => {
  let brandId = ctx.params.brandId
  ctx.body = {
    success: true,
    list: [
      {
        brandId,
        templateId: "100100001",
        name: "banner图"
      }
    ]
  }
})

router.all('/getTemplateById/:templateId', ctx => {
  let templateId = ctx.params.templateId

  ctx.body = {
    templateId,
    optionsList: {
      bgimage: {
        label: '背景图片',
        component: "input",
        value: null
      }
    }
  }
})


router.post('/previewTemplate', ctx => {
  let data = ctx.request.body

  ctx.body = {a: 222, data}

})



module.exports = router